{% extends 'layout.html' %}
{% block title %}表单结果{% endblock %}
{% block body %}
    <div class="row justify-content-center">
        <div class="col">
            <h1>表单参数</h1>
            <div class="table-responsive">
                <table class="table table-bordered table-hover table-striped">
                    <thead>
                    <tr>
                        <th scope="col">参数</th>
                        <th scope="col">值</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for key,value in data.items() %}
                        <tr>
                            <td>{{ key }}</td>
                            <td>{{ value }}</td>
                        </tr>
                    {% endfor %}
                    <tr>
                        <td>文件</td>
                        <td>{{ request.files['file'].filename if request.files['file'] else '' }}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>


    <div class="row justify-content-center">
        <div class="col">
            <h1>上传的文件</h1>
            <div class="table-responsive">
                <table class="table table-bordered table-hover table-striped">
                    <thead>
                    <tr>
                        <th scope="col">文件名</th>
                        <th scope="col">文件内容</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for file in session.files %}
                        <tr>
                            <td>{{ file }}</td>
                            <td><a href="{{ url_for('get_uploaded_file',filename=file) }}">点击查看</a></td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>


{% endblock %}